<% title _("Domains") %>

<% title_actions new_link(_("Create Domain")), help_button %>

<table class="<%= table_css_classes 'table-fixed' %>" id="domains_list">
  <thead>
    <tr>
      <th class="col-md-8"><%= sort :name, :as => s_("Domain|Fullname") %></th>
      <th><%= _("Hosts") %></th>
      <th><%= _('Actions') %></th>
    </tr>
  </thead>
  <tbody>
    <% @domains.each do |domain| %>
    <tr>
      <td class="ellipsis"><%= link_to_if_authorized (domain.fullname.empty? ? domain.name : domain.fullname), hash_for_edit_domain_path(:id => domain).merge(:auth_object => domain, :authorizer => authorizer) %></td>
      <td><%= link_to hosts_count[domain], hosts_path(:search => "domain = #{domain}") %>
      <td class="col-md-1"><%= action_buttons(display_delete_if_authorized hash_for_domain_path(:id => domain).merge(:auth_object => domain, :authorizer => authorizer), :data => { :confirm => _("Delete %s?") % domain.name }) %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= will_paginate_with_info @domains %>
